package com.example.recruitment_website.service.Impl;

import com.example.recruitment_website.domain.Feedback;
import com.example.recruitment_website.repository.FeedbackRepository;
import com.example.recruitment_website.service.FeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class FeedbackImpl implements FeedbackService {
    @Autowired
    FeedbackRepository feedbackRepository;
    @Override
    public int addFeedBack(String title, int userId, String content) {
        Feedback feedback = new Feedback(userId,title,content);
        try {
            feedbackRepository.save(feedback);
        }catch (Exception e){
            return 0;
        }
        return 1;
    }
}
